Telegram Group & Telegram Channel
Вы используете локальные переменные в LINQ и используете let? 👇

Ключевое слово let позволяет вводить временную переменную прямо внутри запроса LINQ — как локальную переменную в цикле.

Разбивайте сложные вычисления на части

Делайте запрос модульнее и чище

Меньше проходов по данным → выше производительность

👉 Простой пример:
csharp


from order in orders
let total = order.Items.Sum(i => i.Price * i.Quantity)
where total > 1000
let categories = order.Items.Select(i => i.Category).Distinct()
select new
{
OrderId = order.Id,
Total = total,
Categories = categories
};

let total = … — вычисляем сумму заказа только один раз

where total > 1000 — фильтруем по готовому значению

let categories = … — собираем уникальные категории



tg-me.com/csharp_1001_notes/675
Create:
Last Update:

Вы используете локальные переменные в LINQ и используете let? 👇

Ключевое слово let позволяет вводить временную переменную прямо внутри запроса LINQ — как локальную переменную в цикле.

Разбивайте сложные вычисления на части

Делайте запрос модульнее и чище

Меньше проходов по данным → выше производительность

👉 Простой пример:
csharp


from order in orders
let total = order.Items.Sum(i => i.Price * i.Quantity)
where total > 1000
let categories = order.Items.Select(i => i.Category).Distinct()
select new
{
OrderId = order.Id,
Total = total,
Categories = categories
};

let total = … — вычисляем сумму заказа только один раз

where total > 1000 — фильтруем по готовому значению

let categories = … — собираем уникальные категории

BY C# 1001 notes




Share with your friend now:
tg-me.com/csharp_1001_notes/675

View MORE
Open in Telegram


C 1001 notes Telegram | DID YOU KNOW?

Date: |

Telegram announces Search Filters

With the help of the Search Filters option, users can now filter search results by type. They can do that by using the new tabs: Media, Links, Files and others. Searches can be done based on the particular time period like by typing in the date or even “Yesterday”. If users type in the name of a person, group, channel or bot, an extra filter will be applied to the searches.

What is Telegram?

Telegram is a cloud-based instant messaging service that has been making rounds as a popular option for those who wish to keep their messages secure. Telegram boasts a collection of different features, but it’s best known for its ability to secure messages and media by encrypting them during transit; this prevents third-parties from snooping on messages easily. Let’s take a look at what Telegram can do and why you might want to use it.

C 1001 notes from sg


Telegram C# 1001 notes
FROM USA